<%--
  Created by IntelliJ IDEA.
  User: empty
  Date: 2025/5/25
  Time: 19:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>登记健康信息</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', sans-serif; /* 统一字体 */
        }

        body {
            background: linear-gradient(135deg, #f0f7ff 0%, #e0ecff 100%); /* 渐变背景 */
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            padding: 20px;
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding: 15px 0;
            border-bottom: 1px solid #d0e0ff; /* 浅色分割线 */
        }

        .header h1 {
            color: #2c5282; /* 深蓝色标题 */
            font-size: 28px;
            font-weight: 600;
        }

        #logout button {
            background-color: #6c757d;
            color: white;
            border: none;
            padding: 10px 18px;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.3s;
            font-size: 14px;
            letter-spacing: 0.5px;
        }

        #logout button:hover {
            background-color: #545b62; /* 深灰悬停色 */
        }

        #app {
            background: white;
            border-radius: 12px; /* 更大圆角 */
            box-shadow: 0 8px 24px rgba(50, 100, 180, 0.1); /* 更强阴影 */
            padding: 35px 40px;
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
        }

        #app h2 {
            color: #2c5282;
            font-size: 24px;
            margin-bottom: 28px;
            padding-left: 12px;
            border-left: 4px solid #4a89dc; /* 左侧蓝线 */
        }

        form {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 自适应网格 */
            grid-gap: 25px;
        }

        label {
            display: flex;
            flex-direction: column;
        }

        label span {
            font-size: 14px;
            color: #555; /* 深灰标签文字 */
            margin-bottom: 8px;
            font-weight: 500;
        }

        input {
            padding: 14px 18px; /* 更大内边距 */
            border: 1px solid #e0e6f0; /* 浅灰边框 */
            border-radius: 8px; /* 更大圆角 */
            font-size: 16px;
            transition: border-color 0.3s, box-shadow 0.3s;
        }

        input:focus {
            outline: none;
            border-color: #4a89dc; /* 蓝色聚焦边框 */
            box-shadow: 0 0 0 3px rgba(74, 137, 220, 0.15); /* 聚焦光晕 */
        }

        button[type="submit"] {
            background-color: #4a89dc; /* 蓝色主按钮 */
            color: white;
            border: none;
            padding: 16px 24px; /* 更大按钮尺寸 */
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
            font-weight: 500;
            margin-top: 20px;
            box-shadow: 0 4px 12px rgba(74, 137, 220, 0.2); /* 按钮阴影 */
            grid-column: 1 / -1; /* 跨列显示 */
        }

        button[type="submit"]:hover {
            background-color: #3672c4; /* 更深蓝色悬停色 */
            transform: translateY(-2px); /* 悬停平移效果 */
            box-shadow: 0 6px 16px rgba(74, 137, 220, 0.3);
        }

        .message {
            margin: 20px auto 0;
            padding: 14px;
            border-radius: 6px;
            text-align: center;
            font-size: 14px;
            max-width: 800px;
            width: 100%;
            animation: fadeIn 0.3s ease;
        }

        .message.error {
            background-color: #ffe6e6; /* 浅红错误提示 */
            color: #d92b2b;
        }

        .message.success {
            background-color: #e6f7ea; /* 浅绿成功提示 */
            color: #1a7930;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
    </style>
</head>
<body>
<div class="header">
    <h1>社区健康信息管理</h1>
    <div id="logout">
        <form action="user-community" name="action" method="post">
            <input type="hidden" name="action" value="returnAdmin">
            <button type="submit">居民首页</button>
        </form>
    </div>
</div>

<div id="app">
    <h2>健康信息登记</h2>
    <form action="addHealthInformation" method="post">
        <label>
            <span>健康档案ID:</span>
            <input type="text" name="health_id" placeholder="请输入健康档案编号">
        </label>
        <label>
            <span>姓名:</span>
            <input type="text" name="health_name" placeholder="请输入姓名" required>
        </label>
        <label>
            <span>性别:</span>
            <input type="text" name="gender" placeholder="请输入性别（男/女/其他）" required>
        </label>
        <label>
            <span>年龄:</span>
            <input type="number" name="age" placeholder="请输入年龄" required>
        </label>
        <label>
            <span>慢性病:</span>
            <input type="text" name="chronic_diseases" placeholder="请填写慢性病史（无则填无）">
        </label>
        <label>
            <span>过敏史:</span>
            <input type="text" name="allergies" placeholder="请填写过敏史（无则填无）">
        </label>
        <button type="submit">提交登记</button>
    </form>
</div>

<div class="message ${message ? 'error' : ''}">${message}</div>
</body>
</html>
